<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>父传子组件</title>
		<script src="https://unpkg.com/vue@next"></script>
	</head>
	<body>
		<!-- 豆雪琴 209010214 -->
		<div id="root">
			<tup></tup>
		</div>
		<script>
			const app=Vue.createApp({
			
					provide:{
						message:'儿子我好饿！'
					}

			});
			app.component('tup',{
				inject:['message'],
				template:`<h1>子组件收到的：{{message}}</h1>`
			});
			const vm=app.mount('#root');
		</script>
	</body>
</html>